#define _CRT_SECURE_NO_DEPRECATE 1

#pragma warning(disable:4996)

#include <iostream>
#include <utility>
#include <assert.h>

using namespace std;
#include "AVLTree.h"
// using namespace aiyimu::AVLTree;


void TestAVLTree1()
{
	// int a[] = { 1,14,51,41,91,9,8,10,2,6,20,50,23 };
	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };


	AVLTree<int, int> t1;
	for (auto e : a) {
		t1.Insert(make_pair(e, e));
	}

	t1.InOrder();
	cout << "IsBalance:" << t1.IsBalance() << endl;
}

void TestAVLTree2()
{
	size_t N = 10000;
	srand(time(0));
	AVLTree<int, int> t1;
	for (size_t i = 0; i < N; i++)
	{
		int x = rand();
		t1.Insert(make_pair(x, i));
	}
	cout << "IsBalance:" << t1.IsBalance() << endl;
}

int main()
{
	TestAVLTree1();
	// TestAVLTree2();
	return 0;
}